package com.liangzi.service_core.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.liangzi.service_core.pojo.entity.SysDictData;
import com.liangzi.service_core.mapper.SysDictDataMapper;
import com.liangzi.service_core.service.SysDictDataService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 字典数据表 服务实现类
 * </p>
 *
 * @author zhj
 * @since 2021-12-13
 */
@Service
public class SysDictDataServiceImpl extends ServiceImpl<SysDictDataMapper, SysDictData> implements SysDictDataService {
    private static final String OUTPATIENT_DICT_TYPE = "visit_dept";
    private static final String BOOKING_STATUS="booking";

    @Autowired
    private SysDictDataMapper sysDictDataMapper;
    @Override
    public List<SysDictData> getOutpatientByDictType() {
        QueryWrapper<SysDictData> wrapper = new QueryWrapper<>();
        wrapper.eq("dict_type",OUTPATIENT_DICT_TYPE);
        List<SysDictData> list = sysDictDataMapper.selectList(wrapper);
        return list;
    }

    @Override
    public List<SysDictData> getBookingStatusByDictType() {
        QueryWrapper<SysDictData> wrapper = new QueryWrapper<>();
        wrapper.eq("dict_type",BOOKING_STATUS);
        List<SysDictData> list = sysDictDataMapper.selectList(wrapper);
        return list;

    }
}
